package com.juanpi.order.configuration;

import com.juanpi.order.configuration.bean.KafkaTopic;
import com.juanpi.order.configuration.dao.KafkaTopicMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xueqing
 *         Created on 2017/2/10.
 */

@Service
public class KafkaTopicService {

    private KafkaTopicMapper kafkaTopicMapper;

    //保存kafka
    public void saveTopic(List<KafkaTopic> listTopic){
        if(listTopic!=null){
            for(KafkaTopic kafkaTopic:listTopic){
                kafkaTopicMapper.deleteKafkaTopicsByKafkaName(kafkaTopic.getKafkaName());
                kafkaTopicMapper.saveKafkaTopics(kafkaTopic);
            }
        }
    }


    public boolean checkWithDbByKafka(List<KafkaTopic> listTopic,String kafkaName){
        List<KafkaTopic> kafkaTopics = kafkaTopicMapper.queryKafkaTopicByKafkaName(kafkaName);

        return false;
    }


}
